<script setup lang="ts">
import { withDefaults, defineProps, defineComponent } from 'vue'

export interface DockProps {
  buttons: { label: string }[]
}

const props = withDefaults(defineProps<DockProps>(), {
  buttons: () => [
    { label: '😃' },
    { label: '😊' },
    { label: '😜' },
    { label: '😍' },
    { label: '🤩' },
    { label: '🥳' },
    { label: '🥶' },
  ],
})
defineComponent({
  name:"FloatingDock"
})
</script>

<template>
  <div class="floating-dock">
    <button
      v-for="(btn, index) in props.buttons"
      :key="index"
      class="dock-button"
      :aria-label="btn.label"
    >
      {{ btn.label }}
    </button>
  </div>
</template>

<style scoped>
.floating-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.dock-button {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
  color: #333;
}

.dock-button:hover {
  transform: scale(1.3);
  background-color: rgba(0, 0, 0, 0.05);
}

/* 可选：点击反馈 */
.dock-button:active {
  transform: scale(1.1);
}
</style>
